﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Globalization;
using System.Threading;


namespace IDE_week2_Forms_project
{
    public partial class Form1 : Form
    {

        public Form1()
        {
            // Sets the UI culture to French (France).
            //Thread.CurrentThread.CurrentUICulture = new CultureInfo("nl-NL");
            InitializeComponent();
        }

        private void button4_Click(object sender, EventArgs e)
        {

            Form f = new Form2();
            //f.Show();
            f.Visible = true;
        }

        private void button3_Click(object sender, EventArgs e)
        {
          
            CultureInfo ci = Thread.CurrentThread.CurrentUICulture;
            if (ci.Name == "nl-NL") {
                Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
                ChangeLanguage("en-US");
            }
            else {
                Thread.CurrentThread.CurrentUICulture = new CultureInfo("nl-NL");
                ChangeLanguage("nl-NL");
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form2));
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
        }

        private void button2_Click(object sender, EventArgs e)
        {
       //     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
       //     this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.Icon = Properties.Resources.form11;
        }

        private void ChangeLanguage(string lang)
        {
            foreach (Control c in this.Controls)
            {
                ComponentResourceManager resources =
                      new ComponentResourceManager(typeof(Form1));
                resources.ApplyResources(c, c.Name, new CultureInfo(lang));
            }
        }

        private void button5_Click(object sender, EventArgs e)
        {
            int[] numbers = new int[10];
            Class1.MakeRandomNumber(numbers);
            label1.Text = numbers[0] + ", " + numbers[1] + ", " + numbers[2];
        }
    }
}
